package com.ruoyi.project.naming.shenxiao.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.naming.shenxiao.domain.ShengXiao;
import com.ruoyi.project.naming.shenxiao.mapper.ShengXiaoMapper;
import com.ruoyi.project.naming.shenxiao.service.IShengXiaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 生肖吉凶Service业务层处理
 *
 * @author shixiangwen
 * @date 2022-05-25
 */
@Service
@DataSource(DataSourceType.DICT)
public class ShengXiaoServiceImpl implements IShengXiaoService {
    @Autowired
    private ShengXiaoMapper shengXiaoMapper;

    /**
     * 查询生肖吉凶
     *
     * @param id 生肖吉凶ID
     * @return 生肖吉凶
     */
    @Override
    public ShengXiao selectShengXiaoById(Long id) {
        return shengXiaoMapper.selectShengXiaoById(id);
    }

    /**
     * 查询生肖吉凶列表
     *
     * @param shengXiao 生肖吉凶
     * @return 生肖吉凶
     */
    @Override
    public List<ShengXiao> selectShengXiaoList(ShengXiao shengXiao) {
        return shengXiaoMapper.selectShengXiaoList(shengXiao);
    }

    /**
     * 新增生肖吉凶
     *
     * @param shengXiao 生肖吉凶
     * @return 结果
     */
    @Override
    public int insertShengXiao(ShengXiao shengXiao) {
        return shengXiaoMapper.insertShengXiao(shengXiao);
    }

    /**
     * 修改生肖吉凶
     *
     * @param shengXiao 生肖吉凶
     * @return 结果
     */
    @Override
    public int updateShengXiao(ShengXiao shengXiao) {
        return shengXiaoMapper.updateShengXiao(shengXiao);
    }

    /**
     * 删除生肖吉凶对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShengXiaoByIds(String ids) {
        return shengXiaoMapper.deleteShengXiaoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除生肖吉凶信息
     *
     * @param id 生肖吉凶ID
     * @return 结果
     */
    @Override
    public int deleteShengXiaoById(Long id) {
        return shengXiaoMapper.deleteShengXiaoById(id);
    }
}
